package model

import (
	"time"
	"gorm.io/gorm"
)

// OperationLog 操作日志
type OperationLog struct {
	ID           uint           `gorm:"primarykey" json:"id"`
	UserID       uint           `gorm:"not null" json:"user_id"`
	Username     string         `gorm:"size:50;not null" json:"username"`
	Module       string         `gorm:"size:50;not null" json:"module"`
	Action       string         `gorm:"size:50;not null" json:"action"` // create:创建 update:更新 delete:删除
	Method       string         `gorm:"size:20;not null" json:"method"` // GET POST PUT DELETE
	Path         string         `gorm:"size:200;not null" json:"path"`
	IP           string         `gorm:"size:50" json:"ip"`
	UserAgent    string         `gorm:"size:500" json:"user_agent"`
	RequestBody  string         `gorm:"type:text" json:"request_body"`
	ResponseBody string         `gorm:"type:text" json:"response_body"`
	Status       int            `json:"status"`
	CreatedAt    time.Time      `json:"created_at"`
	UpdatedAt    time.Time      `json:"updated_at"`
	DeletedAt    gorm.DeletedAt `gorm:"index" json:"-"`
} 